﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IRCPhase2Tester.Daemons
{
   public class DaemonBase
    {
        public DaemonBase(int nodeID, string configurationFileName)
        {
            this.ConfigurationFileName = configurationFileName;
            this.NodeID = nodeID;
            this.nodeConfigurations = IRC.Utilities.ConfigFileParser.LoadConfigurationFromPath(this.ConfigurationFileName);
        }
        public string ConfigurationFileName
        {
            get;
            set;
        }

        public List<IRC.Utilities.Entities.NodeConfiguration> nodeConfigurations
        {
            get;
            set;
        }

        public int IRCLocalPort
        {
            get
            {
                return this.nodeConfigurations.FirstOrDefault(x => x.NodeID == this.NodeID).LocalPort;
            }
        }

        public int NodeID
        {
            get;
            set;
        }

        public virtual void Suspend()
        {
        }

        public virtual void Kill()
        { 
        }

        public virtual void Start() 
        {
        }

        public virtual void Silence()
        {
        }

        public virtual void Unsilence()
        {
        }

    }
}
